package club.zynight.crawler.utils;

import club.zynight.crawler.entity.Location;
import club.zynight.crawler.entity.SenicSpotEntity;

public class DataUtils {
    public static void setEntityParameterValue(int index,String value,SenicSpotEntity entity) {
        switch (index) {
            case 0:
                entity.setId(Integer.valueOf(value));
                break;
            case 1:
                entity.setName(value);
                break;
            case 2:
                entity.setProvince(value);
                break;
            case 3:
                entity.setCity(value);
                break;
            case 4:
                entity.setCounty(value);
                break;
            case 5:
                entity.setCountyId(value);
                break;
            case 6:
                entity.setTel(value);
                break;
            case 7:
                entity.setArea(value);
                break;
            case 8:
                entity.setAddress(value);
                break;
            case 9:
                entity.setBigCategory(value);
                break;
            case 10:
                entity.setSmallCategory(value);
                break;
          /*  case 11:
                entity.setLongitude(Double.valueOf(value));
                break;
            case 12:
                entity.setLatitude(Double.valueOf(value));
                break;*/
        }
    }

    public static void setEsSource(int index, String value, SenicSpotEntity entity, Location location) {
        switch (index) {
            case 0:
                entity.setId(Integer.valueOf(value));
                break;
            case 1:
                entity.setName(value);
                break;
            case 2:
                entity.setProvince(value);
                break;
            case 3:
                entity.setCity(value);
                break;
            case 4:
                entity.setCounty(value);
                break;
            case 5:
                entity.setCountyId(value);
                break;
            case 6:
                entity.setTel(value);
                break;
            case 7:
                entity.setArea(value);
                break;
            case 8:
                entity.setAddress(value);
                break;
            case 9:
                entity.setBigCategory(value);
                break;
            case 10:
                entity.setSmallCategory(value);
                break;
            case 11:
                location.setLon(Double.valueOf(value));
                break;
            case 12:
                location.setLat(Double.valueOf(value));
                break;
          /*  case 11:
                entity.setLongitude(Double.valueOf(value));
                break;
            case 12:
                entity.setLatitude(Double.valueOf(value));
                break;*/
        }
    }


}
